package com.ym.b2b.product.dao.impl;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

import com.ym.b2b.commons.dao.BaseDao;
import com.ym.b2b.product.dao.EmBProductPictureDAO;
import com.ym.b2b.product.sqlbean.EmBProductPicture;

@Repository
public class EmBProductPictureDAOImpl<T> extends BaseDao<T> implements EmBProductPictureDAO {

    public void insertEmBProductPicture(EmBProductPicture record) throws DataAccessException {
        insert("EM_B_PRODUCT_PICTURE.insertEmBProductPicture", record);
    }

    public int updateEmBProductPicture(EmBProductPicture record) throws DataAccessException {
        int rows = update("EM_B_PRODUCT_PICTURE.updateEmBProductPicture", record);
        return rows;
    }

    public List<EmBProductPicture> searchEmBProductPicture(EmBProductPicture key) throws DataAccessException {

        return list("EM_B_PRODUCT_PICTURE.searchEmBProductPicture", key);
    }

    public int deleteEmBProductPicture(Long pictureId) throws DataAccessException {
        int rows = delete("EM_B_PRODUCT_PICTURE.deleteEmBProductPicture", pictureId);
        return rows;
    }

    @Override
    public Long searchPageEmBProductPictureNum(EmBProductPicture embproductpicture) throws DataAccessException {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public void searchPageEmBProductPicture(EmBProductPicture embproductpicture) throws DataAccessException {
        // TODO Auto-generated method stub

    }

    @Override
    public EmBProductPicture showEmBProductPictureDetail(EmBProductPicture key) throws DataAccessException {
        return null;
    }

    @Override
    public Integer codeHasDefault(String code) throws DataAccessException {
        return (Integer) find("EM_B_PRODUCT_PICTURE.codeHasDefault", code);

    }

    @Override
    public void doDefaultPicture(String productCode) throws DataAccessException {
        update("EM_B_PRODUCT_PICTURE.doDefaultPicture", productCode);

    }
}
